package net.rlair.sbdemo.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author:
 * @description:
 * @create:2019-03-15 13:29
 */
@Component
@Aspect
@Order(1)
public class GuanboAspect2 {

    @Pointcut("execution(* net.rlair.sbdemo.controller.ZhaozichenController.list(..))")
    public void guanboAspects() {
    }

    @AfterReturning("guanboAspects()")
    public void afterReturning() {
        System.out.println("GuanboAspects2 afterReturning ......");
    }

    @Around("guanboAspects()")
    public Object around(ProceedingJoinPoint jp) throws Throwable {
        System.out.println("GuanboAspects2 around before......");
        Object o = jp.proceed();
        System.out.println("GuanboAspects2 around after......");
        return o;
    }
}
